<?php

namespace App;

use Illuminate\Foundation\Auth\Type as Authenticatable;
use Illuminate\Database\Eloquent\Model;
use DB;
class Goodsattr extends Model
{
	public $table='goods_attr';
	public function getAddGoodsAttr($attr){
    	return self::insertGetId($attr);
    }
    public function getList($goods_id,$attr_type=1){
    	//$row = ['title'=>$_POST['title'],'content'=>$_POST['content']];
    	return self::where(['goods_id'=>$goods_id,'attr_type'=>$attr_type])->select('goods_attr_id','attr_value')->get()->toArray();
    }
    public function getLists($goods_id,$attr_type=1){
    	//$row = ['title'=>$_POST['title'],'content'=>$_POST['content']];
    	return self::where(['goods_id'=>$goods_id,'attr_type'=>$attr_type])->get()->toArray();
    }       
}